import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/pc/index/index.vue'
import Login from '../views/pc/login/login.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: Index
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
]

//每次进入页面时都初始化滚轴位置
const scrollBehavior = function (to, from, savedPosition) {
  return { x: 0, y: 0 };
}
const router = new VueRouter({
  routes,
  scrollBehavior
})

export default router
